
from application import db
from common.models.user import User
from common.models.study_list import StudyList

class StudyComment(db.Model):
    __tablename__ = 'study_comment'

    id = db.Column(db.Integer, primary_key=True)
    score1 = db.Column(db.Integer)
    score2 = db.Column(db.Integer)
    score3 = db.Column(db.Integer)
    score4 = db.Column(db.Integer)
    score5 = db.Column(db.Integer)
    score6 = db.Column(db.Integer)
    score7 = db.Column(db.Integer)
    comment1 = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'))
    comment2 = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'))
    comment3 = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'))
    sumscore = db.Column(db.Integer)

    updated_time = db.Column(db.DateTime)
    created_time = db.Column(db.DateTime)

    sid = db.Column(db.Integer, db.ForeignKey('study_list.id'))
    uid = db.Column(db.Integer, db.ForeignKey('user.id'))

    creater = db.relationship('User', foreign_keys=uid)
    studycourse = db.relationship('StudyList',foreign_keys=sid)




